{% extends "base.html" %}

{% block title %}首页{% endblock %}

{% block page_content %}
    <table class="table table-bordered">
    <tr>
        <th>ID(int)</th>
        <th>NAME(char(16))</th>
        <th>x(int)</th>
        <th>y(int)</th>
        <th>crtdate(tmstmp)</th>
        <th>upddate(tmstmp)</th>
        <th>state(short)</th>
        <th>operate</th>
    </tr>
        {% for i in posts %}
            <tr>
                <td>{{ i[0] }}</td>
                <td>{{ i[1] }}</td>
                <td>{{ i[2] }}</td>
                <td>{{ i[3] }}</td>
                <td>{{ i[4] }}</td>
                <td>{{ i[5] }}</td>
                <td>{{ i[6] }}</td>
                <td>
                    <form action="singledelete" method="post" enctype="multipart/form-data">
                        <button type="submit" value={{i[0]}} name="delete">Delete</button>
                    </form>
                </td>
            </tr> 
    {% endfor %}
        <tr><form action="add" method="post" enctype="multipart/form-data">
            <td><input type="text" name="id" size="6"></td>
            <td><input type="text" name="name" size="6"></td>
            <td><input type="text" name="x" size="6"></td>
            <td><input type="text" name="y" size="6"></td>
            <td></td>
            <td></td>
            <td><input type="text" name="state" size="6"></td>
            <td><input type="submit" value="Add"></td>
        </form></tr>
    </table>

{% endblock %}